Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub workflow files #7585

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pallavisontakke
Copy link
Contributor

@pallavisontakke pallavisontakke commented Jan 10, 2025

to create minor release.
Change to no more use a fork, but a branch directly. Prefix release branch , as it'll be a normal branch on timescaledb now.

Generalise script to create the Changelog PR on main, when the minor-version branch, e.g. 2.18.x is not yet available.

This way, we can run these steps for a new minor version release:

  • create the Changelog+post-release PR on main,
  • create the new minor-version-branch , e.g. 2.18.x
  • create the Release PR on minor-version-branch
    , with PRs being created by the same script.

Disable-check: force-changelog-file
Disable-check: commit-count

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.27%. Comparing base (59f50f2) to head (45e4d68).
Report is 700 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7585      +/-   ##
==========================================
+ Coverage   80.06%   82.27%   +2.20%     
==========================================
  Files         190      238      +48     
  Lines       37181    43790    +6609     
  Branches     9450    10995    +1545     
==========================================
+ Hits        29770    36028    +6258     
- Misses       2997     3425     +428     
+ Partials     4414     4337      -77     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pallavisontakke pallavisontakke force-pushed the minor_release_github_action_645 branch from 483aa0b to aaa5706 Compare January 13, 2025 05:05
@pallavisontakke pallavisontakke changed the title Add a GitHub workflow file Add GitHub workflow files Jan 13, 2025
UPDATE_FILE="$CURRENT_VERSION--$NEW_VERSION.sql"
DOWNGRADE_FILE="$NEW_VERSION--$CURRENT_VERSION.sql"
LAST_UPDATE_FILE="$LAST_VERSION--$CURRENT_VERSION.sql"
LAST_DOWNGRADE_FILE="$CURRENT_VERSION--$LAST_VERSION.sql"

RELEASE_BRANCH_EXISTS=$(git branch -a |grep -c "origin/$RELEASE_BRANCH"|cut -d ' ' -f 1)

if [[ $RELEASE_BRANCH_EXISTS == '0' ]]; then
Copy link
Member

@akuzm akuzm Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this script can also create the release branch? I think that for ease of understanding, we should choose one of these options:

  1. make this script create the branch if it doesn't exist, and remove the small script that only handles branch creation
  2. keep the small script for branch creation, but remove it from this one, and make it require the branch to be already created.

I think if the branch can be created by two different scripts, it might become confusing, especially since they can diverge subtly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script does not create the release branch. It checks if the release branch is created.

If release-branch exists:

  • it creates Release PR on the release-branch, adjusting versions.

If release-branch does not exist:

  • it creates Changelog+post-release PR on main branch, adjusting versions accordingly.

i.e. overall through this action, we want to create 2 PRs & 1 release-branch, for each minor release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I think I understand. Can we make this depend on the argument instead? I.e. if you pass it "main" as an argument, it creates the PR to main branch, and if you pass the name of the release branch, it creates a PR to there. This will make it easier to retry any of the steps, i.e. if the release branch was created, but the PR to main failed for some reason, and we need to create it again.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [[ $RELEASE_BRANCH_EXISTS == '0' ]]; then
if [[ $RELEASE_BRANCH_EXISTS -eq 0 ]]; then

Nit.

To create minor release PR commit.
Change to no more use a fork, but a branch directly.
Prefix release branch , as it'll be a normal branch on timescaledb now.
To create minor release branch.
Adjust script to work without fork, directly.
@pallavisontakke pallavisontakke force-pushed the minor_release_github_action_645 branch from 2fa618b to 01c617f Compare January 14, 2025 11:58
for minor release.

For better understanding:
- Edit names of steps in the workflow
- Edit branch names in the script
@pallavisontakke pallavisontakke requested a review from akuzm January 14, 2025 13:21
@@ -129,6 +138,15 @@ done

cd ..


if [[ $RELEASE_BRANCH_EXISTS == '0' ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [[ $RELEASE_BRANCH_EXISTS == '0' ]]; then
if [[ $RELEASE_BRANCH_EXISTS -eq 0 ]]; then

Nit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants